package com.cam.generator.dto;

import com.cam.framework.crud.CrudDTO;
import com.cam.framework.utils.StringUtils;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class GenCodeDTO extends CrudDTO {

    private static final long serialVersionUID = 1L;

    private String tableName;

    private String entityName;

    private String packagePath;

    private String permission;

    private String viewPath;

    private String moduleName;

    /*
    * 模块类型，有树表、子表、主表之分
    * 如果是子表，则必须选择主表
    * */
    private String moduleType;

    private GenCodeDTO mainModule;

    private List<GenCodeFieldDTO> fieldList = new ArrayList<>();

    public String getEntityLCName() {
        return StringUtils.pascalToCamelCase(this.entityName);
    }

    public String getEntityHyphenName() {
        return StringUtils.pascalToHyphenCase(this.entityName);
    }

}
